package com.mm.cloud.lease.service;

import com.mm.cloud.common.core.result.Result;
import com.mm.cloud.lease.dto.room.form.BatchSaveRoomDTO;
import com.mm.cloud.lease.dto.room.form.DeleteRoomDTO;
import com.mm.cloud.lease.dto.room.form.SaveRoomDTO;
import com.mm.cloud.lease.dto.room.form.UpdateRoomDTO;
import com.mm.cloud.lease.dto.room.query.QueryRoomDTO;
import com.mm.cloud.lease.entity.Room;
import com.mm.cloud.lease.vo.room.RoomPageVO;
import com.mm.cloud.lease.vo.room.RoomVO;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.validation.constraints.NotNull;

import java.util.List;

/**
 * <p>
 * 房间 服务类
 * </p>
 *
 * @author mr
 * @since 2025-07-01
 */
public interface IRoomService extends IService<Room> {

    /**
     * 保存房间
     *
     * @param dto
     * @return
     */
    Result<Long> saveRoom(SaveRoomDTO dto);

    /**
     * 修改房间
     *
     * @param dto
     * @return
     */
    Result<String> updateRoom(UpdateRoomDTO dto);

    /**
     * 删除房间
     *
     * @param dto
     * @return
     */
    Result<String> deleteRoom(DeleteRoomDTO dto);

    /**
     * 批量保存房间
     *
     * @param dto
     * @return
     */
    Result<String> batchSaveRoom(BatchSaveRoomDTO dto);

    /**
     * 获取房间详情
     *
     * @param id
     * @return
     */
    Result<RoomVO> getRoom(@NotNull(message = "主键id不能为空") Long id);

    /**
     * 获取房间列表
     *
     * @param dto
     * @return
     */
    Result<List<RoomPageVO>> getRoomList(QueryRoomDTO dto);

    /**
     * 校验房间是否可租
     *
     * @param id 房间id
     * @return 成功表示可租，失败返回原因
     */
    Result<String> checkRoomRentable(@NotNull(message = "主键id不能为空") Long id);

}
